package mysql

import (
	"gorm.io/gorm"
	"mouth-project/global"
)

//聊天

type Chat struct {
	gorm.Model
	UserId   int64  `gorm:"type:int(10)comment:用户Id;"`
	ObjectId int64  `gorm:"type:int(10);comment:对象Id"`
	text     string `gorm:"type:varchar(50);comment:聊天内容"`
}

//创建聊天

func (c *Chat) ChatCreate() error {
	return global.Db.Create(&c).Error
}

func (c *Chat) Delete() error {
	return global.Db.Where("id = ?", c.ID).Error
}
